package net.huashitong.index.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.index.dao.EnterpriseDao;
import net.huashitong.index.entity.EnterpriseEntity;
import net.huashitong.index.filter.EnterpriseFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EnterpriseService extends StringPKService<EnterpriseEntity> {

    @Autowired
    private EnterpriseDao dao;
    @Autowired
    private SysTableService sysTableService;

    @Override
    protected BaseDao<EnterpriseEntity, String> getDao() {
        return dao;
    }
    @Override
    protected void beforeSave(EnterpriseEntity obj) {
        obj.setSysId(sysTableService.updateMaxSysId("t_eco_etprise",null));
    }

    public List<EnterpriseEntity> queryByFilterNoPage(EnterpriseFilter enterpriseFilter){
        return dao.queryByFilterNoPage(enterpriseFilter);
    }
}
